/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 按钮容器样式 */
.button-container {
    display: flex;
    gap: 15px;
    padding: 1.5rem 0;
    background: transparent !important;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}


/* 内容区域样式 */
.content {
    margin: 30px auto;
    max-width: 1200px;
    padding: 0;
    background: transparent !important;
    border-radius: 12px;
    box-shadow: none;
}
/* 调整内容区域位置 */
#selectedCourses, #learnedMaterials
 {
    margin-top: 1rem;
}
/* 课程卡片样式 */
#selectedCourseList, #learnedResourceList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.course-item, .resource-item {
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e3e9f5;
    transition: transform 0.2s ease;
    position: relative;
}

.course-item:hover, .resource-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(74,144,226,0.1);
}

.course-item h3 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1em;
}

/* 进度条样式 */
.progress-bar {
    height: 8px;
    background: #e0e6ef;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #63b3ff);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 章节列表样式 */
#chapterList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chapter-item {
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #4a90e2;
    transition: background 0.2s ease;
}

.chapter-item:hover {
    background: #eef4ff;
}

/* 资源列表样式 */
#resourceList {
    list-style: none;
}

.resource-item {
    padding: 15px;
    margin: 10px 0;
    background: #f8f9ff;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-type {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    background: #eef4ff;
    color: #4a90e2;
}

/* 筛选栏样式 */
#chapterFilter, #fileTypeFilter {
    padding: 8px 12px;
    border: 1px solid #dde3eb;
    border-radius: 6px;
    background: white;
    margin-left: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .button-container {
        flex-wrap: wrap;
        padding: 15px;
    }
    
    .modal-content {
        width: 90%;
        margin: 20px auto;
    }
    
    .course-item, .resource-item {
        padding: 15px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 课程卡片样式 */
.course-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.course-title {
    color: #2c3e50;
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
}

.course-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #7f8c8d;
}

.meta-item i {
    margin-right: 0.3rem;
}

.detail-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.detail-item {
    text-align: center;
    padding: 0.5rem;
}

.detail-label {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.detail-value {
    display: block;
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* 资源卡片样式 */
.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.resource-title {
    margin: 0;
    font-size: 1.2rem;
}

.resource-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.resource-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}



.btn-icon i {
    font-size: 0.9rem;
}

/* 操作按钮样式 */
.action-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    font-size: 14px;
    color: white;
    background: #3498db; /* 基础蓝色 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-btn i {
    margin-right: 8px;
    font-size: 16px;
}

.chapter-btn { background: #2980b9; }
.resource-btn { background: #3498db; }
.preview-btn { background: #5dade2; }
.select-course-btn { background: #2ecc71; }
.drop-course-btn { background: #e74c3c; }
.add-chapter-btn { background: #9b59b6; }
.delete-chapter-btn { background: #e67e22; }
.upload-resource-btn { background: #1abc9c; }

/* 悬停效果 */
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}


/* 按钮容器布局 */
.course-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 15px 0;
    border-top: 1px solid #eee;
    margin-top: 15px;
    min-height: 50px;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 10px;                      
} 

/* 章节容器 */
.chapter-container {
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.chapter-container:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 章节标题部分 */
.chapter-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    min-width: 0; /* 添加这一行，允许内容收缩 */
}

.chapter-badge {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    margin-right: 15px;
    font-size: 0.9em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0; /* 防止徽章被压缩 */
}

.chapter-title {
    margin: 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
}

/* 章节内容部分 */
.chapter-content {
    background: #f9fafc;
    border-radius: 6px;
    padding: 15px;
}

.content-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.content-icon {
    color: #4e73df;
    margin-right: 10px;
    font-size: 1.2em;
}

.content-title {
    margin: 0;
    color: #555;
    font-size: 1.1em;
    font-weight: 500;
}

.content-text {
    line-height: 1.6;
    color: #444;
    padding-left: 10px;
    border-left: 3px solid #e0e6ff;
}

/* 课程卡片样式 */
.course-box {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.course-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 课程头部信息 */
.course-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.course-title {
    color: #2c3e50;
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 课程详情卡片 */
.detail-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.detail-item {
    text-align: center;
    padding: 0.5rem;
}

.detail-label {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.detail-value {
    display: block;
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* 课程描述 */
.course-description {
    margin: 1rem 0;
}

.description-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 课程页脚 */
.course-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.weeks-info, .toggle-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

/* 按钮组样式 */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    gap: 8px;
    justify-content: center;
}

.action-btn i {
    font-size: 16px;
}

/* 不同按钮颜色 */
.chapter-btn { background: #2980b9; }
.resource-btn { background: #3498db; }
.preview-btn { background: #5dade2; }
.drop-btn { background: #e74c3c; }

/* 图标颜色定义 */
.text-primary { color: #131315; }
.text-teacher { color: #e74a3b; }
.text-time { color: #f6c23e; }
.text-location { color: #1cc88a; }
.text-tutor { color: #36b9cc; }
.text-credits { color: #ff6b6b; }
.text-period { color: #6b66ff; }
.text-assessment { color: #ff9e66; }
.text-objective { color: #5c7cfa; }
.text-week { color: #8e44ad; }
.text-toggle { color: #3498db; }

/* 文本渐变效果 */
.text-gradient {
    background: linear-gradient(90deg, #161717, #1a1e2a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 考核方式专用样式 */
.assessment-item {
    display: flex;
    align-items: flex-start;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

.assessment-icon {
    margin-right: 12px;
    font-size: 1.3em;
    padding-top: 2px;
}

.assessment-content {
    flex: 1;
}

.assessment-value {
    margin-top: 6px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    line-height: 1.5;
    color: #5a5c69;
    border-left: 3px solid #4e73df;
}

.course-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px auto;
    width: calc(100% - 40px);
    max-width: 1200px;
}

@media (max-width: 1024px) {
    .course-list-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .course-list-container {
        grid-template-columns: 1fr;
    }
    
    .course-box {
        padding: 15px;
    }
    
    .button-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .course-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .detail-card {
        grid-template-columns: 1fr;
    }
}

.resource-card {
    padding: 15px;
    margin: 10px 0;
    background: #f8f9ff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resource-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.resource-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.resource-btn {
    padding: 8px 12px;
    border-radius: 6px;
    background: #4a90e2;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.version-item {
    transition: all 0.2s ease;
}

.action-btn {
    transition: all 0.2s ease;
    font-size: 14px;
}

.version-header {
    min-height: 40px;
}

/* 添加居中样式 */
.empty-state {
    display: flex;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50vh; /* 确保有足够高度 */
    padding: 40px; /* 内边距 */
    background: rgba(255, 255, 255, 0.7); /* 半透明白色背景 */
    border-radius: 10px; /* 圆角 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 阴影 */
    text-align: center;
}

.empty-icon {
    margin-bottom: 1.5rem;
}

.empty-icon i {
    font-size: 3rem;
    color: #0d4887;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.empty-description {
    font-size: 1rem;
    color: #718096;
    max-width: 400px;
    margin-bottom: 1.5rem;
}

.action-btn {
    margin-top: 1rem;
}

/* 已学资源列表容器 */
#learnedResourceList {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: transparent; /* 确保列表容器透明 */
}

/* 已学资源卡片 - 修复背景并添加视觉效果 */
.learned-resource-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(248, 249, 255, 0.7) 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 4px solid #4a90e2;
    border-top: 1px solid #e0e6ff;
    border-right: 1px solid #e0e6ff;
    border-bottom: 1px solid #e0e6ff;
}

/* 卡片悬停效果 */
.learned-resource-card:hover {
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.2);
    transform: translateY(-3px);
    background: linear-gradient(135deg, #ffffff 0%, #edf2ff 100%);
    border-left: 4px solid #2c5282;
}

/* 资源头部样式 */
.resource-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

/* 资源图标样式 */
.resource-icon {
    font-size: 28px;
    color: #4a90e2;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f5f8;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

/* 资源信息区域 */
.resource-info {
    display: flex;
    flex-direction: column;
}

/* 资源标题样式 */
.resource-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

/* 资源元信息样式 */
.resource-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #4a5568;
}

.resource-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
}

/* 操作按钮区域 */
.resource-actions {
    display: flex;
    gap: 10px;
}

/* 按钮基础样式 */
.action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-btn i {
    font-size: 14px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 预览按钮样式 */
.preview-btn {
    background: #4299e1;
    color: white;
}

.preview-btn:hover {
    background: #3182ce;
}

/* 下载按钮样式 */
.download-btn {
    background: #48bb78;
    color: white;
}

.download-btn:hover {
    background: #38a169;
}

/* 标记未学按钮样式 */
.unlearn-btn {
    background: #f56565;
    color: white;
}

.unlearn-btn:hover {
    background: #e53e3e;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .learned-resource-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .resource-actions {
        width: 100%;
        justify-content: flex-end;
    }
}